<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddColumnsToSingleDiscountConditionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('el_single_discount_conditions', function (Blueprint $table) {
            $table->string('type')->nullable();  //折扣类型
            $table->decimal('price',15,2)->nullable();  //折扣值：价格或折扣
            $table->text('value')->nullable()->change();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('el_single_discount_conditions', function (Blueprint $table) {
            $table->dropColumn(['type','price']);
        });
    }
}
